#include <stdio.h>
int main()
{
    int arr[10][10] = {0}, num[10] = {0};
    int i, j, count, sum;

    for (i = 0; i < 10; i++)
    {
        for (j = 0; j < 10; j++)
        {
            scanf("%1d", &arr[i][j]);
            if (1 == arr[i][j])
            {
                num[i]++;
                num[j]++;
            }
        }
    }
    count = sum = 0;
    for (i = 0; i < 10; i++)
    {
        for (j = i + 1; j < 10; j++)
        {
            if (num[i] + num[j] >= 9)
                count++;
            sum++;
        }
    }
    if (sum == count)
        printf("True");
    else
        printf("False");

    return 0;
}